home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-09-14 | 2.6 KB | 83 lines | [TEXT/MPS ] |
- ***********************************************************************
- ***
- *** Defer Cursor
- *** This program defers the cursor updating that normally happens
- *** during slot VBL time. Since the cursor updating can take as
- *** long as 900µSec, and holds off other slot interrupts, it is
- *** handy to be able to defer the updating to a more civilized time.
- *** This program replaces the normal jCrsrTask with an RTS, and installs
- *** a VBL task that calls jCrsrTask routine every VBL.
- ***
- *** Since the normal VBLs are a level of interrupt lower than slot
- *** interrupts, the cursor updating will not hold off slot interrupts.
- ***
- *** This is a one way street. A real implementation should restore
- *** the regular jCrsrTask when this scheme is no longer needed.
- ***
- ***
- *** Build commands:
- ***
- *** asm DeferCrsr.a -lo DeferCrsr.a.lst -l
- *** link DeferCrsr.a.o -o DeferCrsr
- ***
- ***********************************************************************
-
- STRING ASIS
- PRINT OFF
- INCLUDE 'Traps.a'
- INCLUDE 'SysEqu.a'
- PRINT ON
-
- ******************************** Entry *******************************
-
- Entry MAIN
-
- ALIGN 2
- bra.s Entry2
-
- ****************************** MyVBLTask *****************************
-
- TaskBegin
- MyVBLTask
-
- move.w #1,vblCount(a0)
- move.l TaskEnd,a0
- jmp (a0)
-
- ***************************** MyjCrsrTask ****************************
-
- MyjCrsrTask
- rts
- TaskEnd
-
- ******************************** Entry2 ******************************
-
- TaskSize EQU TaskEnd-TaskBegin
- VBLEntry EQU TaskSize+4 ;keep the old jCrsrTask pointer in between the
- ; tasks and VBLTask record
-
- Entry2
- move.l #TaskSize+18,d0 ;18 bytes = VBLTask record and a pointer
- _NewPtr ,SYS,CLEAR ;make a block in the system heap
- bne.s Abort
- move.l a0,a2 ;save the pointer
- move.l a0,a1 ;a0 = source, a1 = destination
- lea MyVBLTask,a0 ;now copy the two tasks over
- move.w #TaskSize,d0
- _BlockMove
-
- move.l a2,a0 ;resotore the pointer
- move.l jCrsrTask,TaskSize(a0) ;put the system jCrsrTask pointer before the VBL record
- adda.l #MyjCrsrTask-TaskBegin,a0 ;make a pointer to our jCrsrTask
- move.l a0,jCrsrTask ; and install it
-
- adda.l #VBLEntry,a2 ;now point to the VBLTask Record
- move.w #vType,qType(a2) ;look for qType, etc. in AIncludes
- move.l a1,vblAddr(a2) ;point to our task
- move.w #1,vblCount(a2) ;do it once every VBL
- move.w #0,vblPhase(a2) ;no phase
- move.l a2,a0 ;a0 must point to VBL task record
- _VInstall
-
- abort _exitToShell ;all's well that ends…
- END